﻿<%@ Page Language="C#" AutoEventWireup="true" EnableEventValidation="false" CodeBehind="PalletizingList.aspx.cs" Inherits="WMS6.Web.Inbound.PalletizingList" meta:resourcekey="Page" %>
<%@ PreviousPageType VirtualPath="~/Inbound/PalletizingQuery.aspx" %>
<%@ Register src="../UserControls/Pager.ascx" tagname="Pager" tagprefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>PalletizingList</title>
    <link href="../style/zh/1/css.css" type="text/css" rel="Stylesheet" id="mycss" />
    <link href="../Css/style.css" type="text/css" rel="stylesheet" />
    <script src="../Js/jquery.js" type="text/javascript"></script>
    <script src="../Js/jquery.simplemodal.js" type="text/javascript"></script>    
    <script src="../Js/jquery.blockUI.js" type="text/javascript"></script>
    <script src="../Js/checkbox.js" type="text/javascript"></script>
    <script src="../Js/util.js" type="text/javascript"></script>
    <script src="../Js/InitPage.js" type="text/javascript"></script>
    
    <script type="text/javascript">
        //初始化页面
        window.onload = function(){
            initListPage();
        }
        
        function returnSearch()
        {
            var from = document.getElementById("hdnFrom").value;
            if(from != "")
            {
                window.location.href = "PalletizingQuery.aspx";
            }
            else
            {
                window.history.go(-1);
            }
        }
          	//隐藏 报表 DIV
		function hiddenReportDiv()
		{
			var flag = document.getElementById("hiddenReportFlag").value
			if(flag == "1")
			{
				document.getElementById("reportDiv").style.display = "block";
				document.getElementById("hiddenReportFlag").value = '0';
			}
			else 
			{
				document.getElementById("reportDiv").style.display = "none";
			}
		}
			//显示 报表 DIV
		function showReport()
		{	
			var pos = getElementPos("htmlbtnReport");	
			document.getElementById("reportDiv").style.top = pos.y+17;
			document.getElementById("reportDiv").style.left = pos.x;  			
			document.getElementById("hiddenReportFlag").value = '1';
		}
	    function showAction()
		{	
			var pos = getElementPos("btnAction");	
			document.getElementById("actionDiv").style.top = pos.y+17;
			document.getElementById("actionDiv").style.left = pos.x;  			
			document.getElementById("hiddenFlag").value = '1';
		}
		  function hiddenDiv()
		  {
			var flag = document.getElementById("hiddenFlag").value
			if(flag == "1")
			{
				document.getElementById("actionDiv").style.display = "block";
				document.getElementById("hiddenFlag").value = '0';
			}
			else 
			{
				document.getElementById("actionDiv").style.display = "none";
			}
		  }
		
		//弹出 打印 入库验收单 的窗口
        function popPrintReceipt(value,ownerID) {
            window.open('../Common/PrintReport.aspx?rtype=printreceipt&receiptID=' + escape(value)+'&OwnerID='+escape(ownerID), 'PrintWindow', 'width=860,height=610,top=50,left=50,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no,status=no');
        }
        
        //锁屏
		function blockScreen()
		{
		    //锁屏
		    $.blockUI.defaults.message = GetBlockUIMsg();
            $.blockUI.defaults.overlayCSS.backgroundColor = GetBlockUIBgColor();
            $.blockUI();
		}
    </script>
</head>
<body>
    <form id="F4017" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        
        <div id="div_List_top">
            <table>
                <tr>
                    <td valign="bottom"><asp:Label ID="lblUom" runat="server" CssClass="label_header" 
                            Text="码盘列表" meta:resourcekey="lblUom"></asp:Label></td>
                    <td><asp:Button ID="btnNew" runat="server" CssClass="button" Enabled="False" Text="<%$Resources:ButtonResource,btnNew%>"                          
                             Visible="False" /></td>
                    <td><asp:Button ID="btnEdit" runat="server" CssClass="button" Enabled="False" 
                            Text="<%$Resources:ButtonResource,btnEdit%>"   OnClick="btnEdit_Click"     /></td>
                    <td><asp:Button ID="btnDelete" runat="server" CssClass="button" Text="<%$Resources:ButtonResource,btnDelete%>"    
                            OnClick="btnDelete_Click"  Enabled="False"  
                          /></td>
                    <td><asp:Button ID="btnRefresh" runat="server" CssClass="button" Enabled="False" Text="<%$Resources:ButtonResource,btnRefresh%>" 
                            /></td>
                    <td> <input id="btnAction" type="button" runat="server" value="<%$Resources:ButtonResource,btnAction%>" class="button"  onclick="showAction();" />    </td>
                    <td><input id="htmlbtnReport" type="button" runat="server" value="<%$Resources:ButtonResource,btnReport%>" class="button"  onclick="showReport();" /></td>
                </tr>
            </table>
        </div>
        <div class="blank8">
        </div>
        
        
        <asp:UpdatePanel ID="up1" runat="server">
            <ContentTemplate>
                <div id="div_List">
                    <div id="div_List_msg">
                        <asp:Label ID="lblMsg" runat="server" CssClass="label_message"></asp:Label>
                    </div>
                    <asp:GridView ID="gvReceipt" runat="server" AutoGenerateColumns="False" AllowSorting="True" 
                            CssClass="gridview" onrowdatabound="gvReceipt_RowDataBound" oninit="gvReceipt_Init" 
                        onsorting="gvReceipt_Sorting" DataKeyNames="RECEIPT_ID,STATUS,IS_PALLETIZED,OWNER_ID" PageSize="20" 
                        Width="1700px" meta:resourcekey="gvReceipt" >
                            <FooterStyle CssClass="GridViewFooterStyle" />
                            <RowStyle CssClass="GridViewRowStyle" />
                            <HeaderStyle CssClass="GridViewHeaderStyle" />
                            <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
                            <Columns>                    
                                <asp:BoundField HeaderText="序号" FooterText="序号" 
                                    meta:resourcekey="No" ><ItemStyle CssClass="GridViewRowWidth_40" /></asp:BoundField>
                                <asp:TemplateField meta:resourcekey="TemplateField" >
                                    <HeaderTemplate>
                                        <img src="../Images/gvSettingpic.gif" id="img01" class="gvSettingImg" onclick="gvUserSetting('4017','gvReceipt');" onmouseover="showGVUserSettingAlt(this);" alt="customize list" />
                                        <asp:CheckBox ID="CheckBox1" runat="server"  
                                            onclick="selectAll(this,'gvReceipt');" meta:resourcekey="CheckBox1" /> 
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <asp:CheckBox ID="chbSelect" runat="server" 
                                            meta:resourcekey="chbSelect"  />
                                    </ItemTemplate>
                                    <FooterTemplate>
                                        <asp:CheckBox ID="CheckBox2" runat="server"   
                                            onclick="selectAll(this,'gvReceipt');" meta:resourcekey="CheckBox2" /> 
                                    </FooterTemplate>
                                    <HeaderStyle HorizontalAlign="Center" CssClass="GridViewRowWidth_50"/>
                                    <ItemStyle HorizontalAlign="Center" CssClass="GridViewRowWidth_50"/>
                                </asp:TemplateField> 
                                
                                 <asp:TemplateField HeaderText="入库通知单号" FooterText="入库通知单号"   
                                    SortExpression="RECEIPT_ID" meta:resourcekey="RECEIPT_ID" >
                                    <ItemTemplate>
                                        <asp:HyperLink ID="HyperLink1" runat="server" Text='<%# Eval("RECEIPT_ID") %>' 
                                            NavigateUrl='<%# FormatUrl("~/Inbound/Palletizing.aspx?from=list&ID={0}",Eval("RECEIPT_ID").ToString()) %>' 
                                            Target="_self" CssClass="hyperlink" 
                                            meta:resourcekey="HyperLink1" ></asp:HyperLink>
                                    </ItemTemplate>
                                    <ItemStyle CssClass="GridViewRowWidth_100" />
                                </asp:TemplateField>                         
                                 <asp:BoundField DataField="OWNER_ID" HeaderText="货主代码" FooterText="货主代码" 
                                    SortExpression="OWNER_ID" meta:resourcekey="OWNER_ID" ><ItemStyle CssClass="GridViewRowWidth_100" /></asp:BoundField>
                                 <asp:BoundField DataField="EXTERNAL_RECEIPT_ID" HeaderText="外部订单号" 
                                    FooterText="外部订单号" SortExpression="EXTERNAL_RECEIPT_ID" 
                                    meta:resourcekey="EXTERNAL_RECEIPT_ID" ><ItemStyle CssClass="GridViewRowWidth_150" /></asp:BoundField>
                                 <asp:BoundField DataField="STATUS_D" HeaderText="状态" FooterText="状态" 
                                    SortExpression="STATUS_D" meta:resourcekey="STATUS_D" ><ItemStyle CssClass="GridViewRowWidth_150" /></asp:BoundField>
                                     <asp:BoundField DataField="IS_PALLETIZED" HeaderText="已码盘" FooterText="已码盘"  SortExpression="IS_PALLETIZED" meta:resourcekey="IS_PALLETIZED" ><ItemStyle CssClass="GridViewRowWidth_100" /></asp:BoundField>
                                 <asp:BoundField DataField="RECEIPT_TYPE_D" HeaderText="类型" FooterText="类型" 
                                    SortExpression="RECEIPT_TYPE_D" meta:resourcekey="RECEIPT_TYPE_D" ><ItemStyle CssClass="GridViewRowWidth_100" /></asp:BoundField>
                                 <asp:BoundField DataField="CARRIER_ID" HeaderText="承运商代码" FooterText="承运商代码" 
                                    SortExpression="CARRIER_ID" meta:resourcekey="CARRIER_ID" ><ItemStyle CssClass="GridViewRowWidth_150" /></asp:BoundField>
                                 <asp:BoundField DataField="WAREHOUSE_REF" HeaderText="仓库参考" FooterText="仓库参考" 
                                    SortExpression="WAREHOUSE_REF" meta:resourcekey="WAREHOUSE_REF" ><ItemStyle CssClass="GridViewRowWidth_150" /></asp:BoundField>
                                <asp:TemplateField FooterText="预期到货日期" HeaderText="预期到货日期" 
                                    SortExpression="EXPECTED_RECEIPT_DATE" 
                                    meta:resourcekey="EXPECTED_RECEIPT_DATE">
                                    <ItemTemplate>
                                        <asp:Label ID="lblExpectedReceiptDate" runat="server" 
                                            Text='<%# GetPreferenceShortDate(Eval("EXPECTED_RECEIPT_DATE").ToString()) %>' 
                                            meta:resourcekey="lblExpectedReceiptDate"></asp:Label>
                                    </ItemTemplate>
                                    <ItemStyle CssClass="GridViewRowWidth_150" />
                                </asp:TemplateField>
                                <asp:TemplateField FooterText="结算日期" HeaderText="结算日期" 
                                    SortExpression="CLOSED_DATE" meta:resourcekey="CLOSED_DATE">
                                    <ItemTemplate>
                                        <asp:Label ID="lblCLOSED_DATE" runat="server" 
                                            Text='<%# GetPreferenceShortDate(Eval("CLOSED_DATE").ToString()) %>' 
                                            meta:resourcekey="lblCLOSED_DATE"></asp:Label>
                                    </ItemTemplate>
                                    <ItemStyle CssClass="GridViewRowWidth_150" />
                                </asp:TemplateField>
                                <asp:BoundField DataField="CREATED_BY" HeaderText="创建人" FooterText="创建人" 
                                    SortExpression="CREATED_BY" meta:resourcekey="CREATED_BY">
                                    <ItemStyle CssClass="GridViewRowWidth_100" />
                                </asp:BoundField>
                               </Columns>
                    </asp:GridView>
                    </div>        
                    <div id="div_pager">
                        <uc1:Pager ID="PagerFooter" runat="server"  OnFirst="btnFirst_Click" OnPrevious="btnPrevious_Click" OnNext="btnNext_Click" OnLast="btnLast_Click" OnGoTo="GoTo_Click"/>
                    </div>
            </ContentTemplate>
            <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btnEdit" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="btnDelete" EventName="Click" />           
            <asp:AsyncPostBackTrigger ControlID="btnList" EventName="Click" />
        </Triggers>
        </asp:UpdatePanel>    
        
        <div id="div_List_bottom">
            <table>
                <tr>
                    <td>
                        <asp:Button ID="btnSearch" runat="server" Text="<%$Resources:ButtonResource,btnNewSearch%>" CssClass="button" Enabled="False" 
                            OnClientClick="javascript:window.location.href='PalletizingQuery.aspx';return false;" 
                              />
                    </td>
                    <td>
                        <asp:Button ID="btnReSearch" runat="server" Text="<%$Resources:ButtonResource,btnReSearch%>" CssClass="button" Enabled="False" 
                            OnClientClick="javascript:returnSearch();return false;" 
                             />
                    </td>
                    <td>
                        <asp:Button ID="btnList" runat="server" Text="<%$Resources:ButtonResource,btnList%>" CssClass="button" Enabled="False" 
                            onclick="btnList_Click"  />
                    </td>
                    <td>
                        <asp:Button ID="btnExport" runat="server" Text="<%$Resources:ButtonResource,btnExport%>" CssClass="button" Enabled="False" 
                            onclick="btnExport_Click"   />
                    </td>
                </tr>
            </table>
        </div>    
         <div id="actionDiv" style="background-color:#FFFFFF; position:absolute;display:none; border:none 0 black">
                 <table width="105" border="0" cellspacing="0" cellpadding="0" id="divcontent_menu">
                     <tr class="bg2" onmouseover="this.className='bg1'" onmouseout="this.className='bg2'">
                         <td class="line" id="tdlnkbtnPalletizing" runat="server"  visible="false" >
                             <asp:LinkButton ID="lnkbtnPalletizing" runat="server"  Text="<%$Resources:ButtonResource,lnkbtnPalletizing%>" 
                                 OnClientClick="blockScreen();"  OnClick="BatchExecutePalletizing" 
                                 ></asp:LinkButton>
                         </td>                          
                     </tr>
                        <tr class="bg2" onmouseover="this.className='bg1'" onmouseout="this.className='bg2'">
                         <td class="line" id="tdlnkbtnRevertPalletizing" runat="server"  visible="false" >
                             <asp:LinkButton ID="lnkbtnRevertPalletizing" runat="server"  Text="<%$Resources:ButtonResource,lnkbtnRevertPalletizing%>" 
                                 OnClientClick="blockScreen();" OnClick="BatchRevertPalletizing" 
                                  ></asp:LinkButton>
                         </td>                          
                     </tr>
                 </table>
            </div>
        <div id="reportDiv" style="background-color:#FFFFFF; position:absolute;display:none;">
                 <table width="105" border="0" cellspacing="0" cellpadding="0" id="divcontent_menu2">
                     <tr class="bg2" onmouseover="this.className='bg1'" onmouseout="this.className='bg2'">
                         <td class="line"  id="tdlnkbtnPrintReceipt" runat="server"  visible="false" >
                             <asp:LinkButton ID="lnkbtnPrintReceipt" runat="server"  Text="<%$Resources:ButtonResource,btnReport%>" 
                                 OnClick="CheckPrintReceipt" ></asp:LinkButton>
                         </td>
                     </tr>
                 </table>
           </div>  
    </div>
    <input type="hidden" id="hdnFrom" runat="server" />
    <input type="hidden" id="hdnActionID" runat="server" />
            <input type="hidden" id="hiddenReportFlag" />       
              <input type="hidden" id="hiddenFlag" />     
    </form>
</body>
</html>
<script language="javascript" type="text/javascript" event="onclick" for="document">
		<!--
		hiddenReportDiv();
		hiddenDiv();
		//-->
</script>
